package com.lqq.designPattern.behavioral_pattern.responsibility;

//部门经理类（具体的处理者）
public class Manager extends Handler {
    public Manager() {
        //部门经理处理3-7天的请假
        super(Handler.NUM_THREE, Handler.NUM_SEVEN);
    }

    @Override
    protected void handleLeave(LeaveRequest leave) {
        if (leave.getNum() <= this.numEnd) {
            System.out.println("部门经理审批中...");
            System.out.println("请假内容：" + leave.getName() + "请假" + leave.getNum() + "天," + leave.getContent());
            System.out.println("部门经理同意请假！");
        }
        else {
            System.out.println("请假天数大于7，部门经理无法审批，正在找上级：总经理...");
        }
    }
}
